#define _CRT_SECURE_NO_WARNINGS 1


//#define MAX_SIZE 5
#include <stdio.h>
#include <stdlib.h>


//struct _Record_Struct
//{
//	unsigned char Env_Alarm_ID : 4;
//	unsigned char Para1 : 2;
//	unsigned char state;
//	unsigned char avail : 1;
//}*Env_Alarm_Record;
//struct _Record_Struct* pointer = (struct _Record_Struct*)
//	malloc(sizeof(struct _Record_Struct) * 5);


//int main()
//{
//    unsigned char puc[4];
//    struct tagPIM
//    {////////////////////////////////////00000010 00101001 
//        unsigned char ucPim1;////////////00000000 00 000 00 0
//        unsigned char ucData0 : 1;//
//        unsigned char ucData1 : 2;//
//        unsigned char ucData2 : 3;//
//    }*pstPimData;
//    pstPimData = (struct tagPIM*)puc;
//    memset(puc, 0, 4);
//    pstPimData->ucPim1 = 2;//010
//
//    pstPimData->ucData0 = 3;//011
//
//    pstPimData->ucData1 = 4;//100
//
//    pstPimData->ucData2 = 5;//101
//    printf("%02x %02x %02x %02x\n", puc[0], puc[1], puc[2], puc[3]);
//    return 0;
//}

//
//int main()
//{
//	int a = 23;
//	printf("%#x", a);
//	return 0;
//}

int cmp(const void* p1, const void* p2)
{

	return *(char*)p1 - *(char*)p2;
}

int main()
{
	char arr[] = "dasd";
	qsort(arr, 4, sizeof(arr[0]), cmp);
	return 0;
}